<!-- Store the value of the field in a variable -->
[Var_Set:'field_value'=(Field:(Var:'field_name', EncodeNone))]
<!-- Store the path to the text file in a variable -->
[Var_Set:'vl_file'=(String_Concatenate: (Var:'vl_folder', EncodeNone), '/', (Var:'field_name', EncodeNone), '.txt')]

[File_Control]
	[Var: 'temp'=(File_ReadLine: (Var:'vl_file', EncodeNone), FileLineNumber=1)]
	[If: (File_CurrentError, ErrorCode) == '0']
<!-- Insert the field name into the Select tag -->
		<SELECT NAME="[Var:'field_name', EncodeNone]" SIZE="1">
			[Loop: (File_GetLineCount: (Var:'vl_file', EncodeNone))]
<!-- Store the value of the line in the text file in a variable -->
				[Var_Set:'vl_item'=(File_ReadLine: (Var:'vl_file', EncodeNone),  FileLineNumber=(LoopCount))]
<!-- Insert the value of the line into the Option tag  --> 
<!-- Insert the Selected attribute by comparing the field value with the value of the line -->
				<OPTION VALUE="[Var:'vl_item', EncodeNone]" 
				[If:(Var:'vl_item', EncodeNone)==(Var:'field_value', EncodeNone)]SELECTED[/If]>
					[Var:'vl_item', EncodeNone]
				</OPTION>
			[/Loop]
		</SELECT>
	[Else]
		File Error: [File_CurrentError, ErrorCode], [File_CurrentError]
	[/If]
[/File_Control]